import 'package:flutter/material.dart';
import 'package:flutter_juwo/common/common_index.dart';
import 'package:flutter_juwo/ui/custom/load_image.dart';
import 'package:flutter_juwo/ui/pages/personalCenterPages/inforPages/initAccount/model/platform_entity.dart';
import 'package:flutter_juwo/ui/res/gaps.dart';

import 'base_dialog.dart';

/// 用户判断的 dialog
class JudjeDialog extends StatefulWidget {
  JudjeDialog({
    Key key,
    this.title,
    this.value,
    this.onPressed,
    this.onCancle,
  }) : super(key: key);

  final Function() onPressed;
  final Function() onCancle;
  final String title;
  final String value;

  @override
  _JudjeDialog createState() => _JudjeDialog();
}

class _JudjeDialog extends State<JudjeDialog> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return BaseDialog(
      title: widget.title,
      child: Container(
        margin: EdgeInsets.only(
            top: ScreenUtil().setWidth(30),
            bottom: ScreenUtil().setWidth(30),
            left: ScreenUtil().setWidth(20),
            right: ScreenUtil().setWidth(20)),
        child: Text(
          widget.value,
          style: TextStyles.custom(
              30, Colours.appC2, Font.PingFangMedium),
        ),
      ),
      onPressed: () {
        widget.onPressed();
      },
      onCancle: () {
        if (null != widget.onCancle) {
          widget.onCancle();
        }
        NavigatorUtils.goBack(context);
      },
    );
  }
}
